GtkCssNode *stepper_b_node;
GtkCssNode *stepper_c_node;
GtkCssNode *stepper_d_node;
+ GtkCssNode *trough_node;
GtkCssNode *slider_node;
GtkOrientation orientation;
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
widget_node = gtk_widget_get_css_node (GTK_WIDGET (range));
+ priv->trough_node = gtk_css_node_new ();
+ gtk_css_node_set_name (priv->trough_node, I_("trough"));
+ gtk_css_node_set_parent (priv->trough_node, widget_node);
+ gtk_css_node_set_state (priv->trough_node, gtk_css_node_get_state (widget_node));
+ g_signal_connect_object (priv->trough_node, "style-changed", G_CALLBACK (node_style_changed_cb), range, 0);
+ g_object_unref (priv->trough_node);
+
priv->slider_node = gtk_css_node_new ();
gtk_css_node_set_name (priv->slider_node, I_("slider"));
- gtk_css_node_set_parent (priv->slider_node, widget_node);
+ gtk_css_node_set_parent (priv->slider_node, priv->trough_node);
gtk_css_node_set_state (priv->slider_node, gtk_css_node_get_state (widget_node));
g_signal_connect_object (priv->slider_node, "style-changed", G_CALLBACK (node_style_changed_cb), range, 0);
g_object_unref (priv->slider_node);
}
}
+ gtk_style_context_save_to_node (context, priv->trough_node);
gtk_style_context_get_margin (context, widget_state, &margin);
x += margin.left;
}
}
+ gtk_style_context_restore (context);
+
if (priv->show_fill_level &&
gtk_adjustment_get_upper (priv->adjustment) - gtk_adjustment_get_page_size (priv->adjustment) -
gtk_adjustment_get_lower (priv->adjustment) != 0)
*
* |[<!-- language="plain" -->
* scale
- * ├── slider
+ * ├── trough
+ * │ ╰── slider
* ╰── marks
* ├── mark.bottom
* ├── mark.top
* ╰── ...
* ]|
*
- * GtkScale has a main CSS node with name scale and a subnode with name slider.
- * If marks are present, there is a marks subnode, below which each mark gets
- * a node with name mark, and either the .top or .bottom style class.
+ * GtkScale has a main CSS node with name scale, and subnodes with names
+ * trough and slider. If marks are present, there is a marks subnode, below
+ * which each mark gets a node with name mark, and either the .top or .bottom
+ * style class.
*/
* scrollbar
* ├── [button.down]
* ├── [button.up]
- * ├── slider
+ * ├── trough
+ * │ ╰── slider
* ├── [button.down]
* ╰── [button.up]
* ]|
*
- * GtkScrollbar has a main CSS node with name scrollbar, and a subnode
- * with name slider. If steppers are enabled, they are represented by up
- * to four additional subnodes with name button. These get the style classes
+ * GtkScrollbar has a main CSS node with name scrollbar, and subnodes with
+ * names trough and slider. If steppers are enabled, they are represented by
+ * up to four additional subnodes with name button. These get the style classes
* .up and .down to indicate in which direction they are moving.
*/